<?php
namespace PsiFramework\Classes\Util\Parameters\Object\Operations;

import("Classes.Util.Parameters.Object.Operation");
import("Classes.Util.Parameters.Object.Operations.Elements.OperationObject");
import("Classes.Util.Parameters.Object.Operations.Elements.OperationClause");
import("Classes.Util.Parameters.Object.Operations.Elements.OperationColumn");

use \PsiFramework\Classes\Util\Parameters\Object\Operation;
use \PsiFramework\Classes\Util\Parameters\Object\Operations\Elements\OperationClause;
use \PsiFramework\Classes\Util\Parameters\Object\Operations\Elements\OperationColumn;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * The Trigger class is the class to manage object parameters select operations
 *
 * @package Util.Parameters.Object
 */
class SelectOperation extends Operation
{

    protected /*OperationColumn[]*/ $_columns ;

    public function __construct(
        /*string*/ $type=null,
        /*OperationObject[]*/ $objects=null,
        /*OperationColumn[]*/ $columns=array(),
        OperationClause $whereClause=null)
    {
        if (is_null($type)) {
            $type = "SELECT" ;
        }
        parent::__construct($type, $objects, $whereClause);
        $this->_columns = $columns ;
    }

    public function getColumns()
    {
        return $this->_columns ;
    }

    public function setColumns(/*OperationColumn[]*/ $columns)
    {
        $this->_columns = $columns ;
    }

    public function addColumn(OperationColumn $column)
    {
        if (is_null($this->_columns)) {
            $this->_columns = array();
        }
        $this->_columns[] = $column ;
    }

}
